require 'crawler/flickr_crawler'
require 'curb'

conditions = nil
conditions = ARGV[0] unless ARGV[0].nil?

crawler = Crawler::FlickrCrawler.new :conditions => conditions

p crawler

log = {:stopped => true}

begin
  log = crawler.start_crawling {|c| p c}
#rescue Curl::Err::HostResolutionError => e
#  p e
#  delay = 60*40
#  p "Time to sleep #{delay}sec"
#  sleep delay
#  retry
end

puts "Finis"
puts log